//package com.daydayup.easypoi.service;
//
//import com.nengchuan.eic.team.constant.BearingConstructionConstant;
//import com.nengchuan.eic.team.dao.BearingConstructionMapper;
//import com.nengchuan.eic.team.model.PageInfo;
//import com.nengchuan.eic.team.model.PageQuery;
//import com.nengchuan.eic.team.model.bo.BearingCalculationBO;
//import com.nengchuan.eic.team.model.bo.ElectricAmountLineLongerBO;
//import com.nengchuan.eic.team.model.bo.PersonnelBO;
//import com.nengchuan.eic.team.model.dto.*;
//import com.nengchuan.eic.team.model.po.LineProjectGroup;
//import com.nengchuan.eic.team.model.vo.BearingConstructionQueryVO;
//import com.nengchuan.eic.team.utils.BearinCalculationUtils;
//import com.nengchuan.model.model.NcPageInfo;
//import com.nengchuan.model.model.WrappedResult;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.collections4.CollectionUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import org.springframework.util.ObjectUtils;
//
//import java.util.*;
//
//import static com.nengchuan.eic.team.constant.BearingConstructionConstant.OUT_SUBSTATION_ENGINEERING_PROJECT;
//
///**
// * <br>
// *
// * @author luo_zm
// * @create 2019/10/30 15:28
// */
//@Service
//@Slf4j
//public class BearingConstructionServiceImpl implements BearingConstructionService {
//
//    @Autowired
//    private BearingConstructionMapper bearingConstructionMapper;
//    private static String ELTPROJECTUSED = "eltProjectUsed";
//    private static String ELTPROJECTGROUPUSED = "eltProjectGroupUsed";
//    private static String LINEPROJECTUSED = "lineProjectUsed";
//    private static String LINEPROJECTGROUPUSED = "lineProjectGroupUsed";
//
//    /**
//     * 现有项目管理关键人员人数输出
//     *
//     * @param unitId
//     * @return
//     */
//    public PersonnelBO getPersonnel(Long unitId) {
//        PersonnelBO pl = bearingConstructionMapper.getPersonnel(unitId);
//        return pl;
//    }
//
//    /**
//     * 依据企业ID计算企业可组建，变电项目部数，变电施工组数，线路项目部数，线路施工项目组数。
//     *
//     * @param unitId
//     * @return
//     */
//    @Override
//    public BearerConstructionDTO getPowerProjects(Long unitId) {
//        List<Integer> list = new ArrayList<>();
//        LineProjectGroup ls = bearingConstructionMapper.getLineProjectGroup(unitId);
//        BearerConstructionDTO bdto = new BearerConstructionDTO();
//        list.add(ls.getAqy());
//        list.add(ls.getJxzh());
//        list.add(ls.getQzj());
//        list.add(ls.getZjy());
//        //组建变电项目部门个数
//        bdto.setEltProjectDep(bearingConstructionMapper.getEltProjectDep(unitId));
//        //组建变电施工组个数
//        bdto.setEltProjectGroup(bearingConstructionMapper.getEltProjectGroup(unitId));
//        //组建线路项目部门个数
//        bdto.setLineProjectDep(bearingConstructionMapper.getLineProjectDep(unitId));
//        //线路施工组个数=架线+组塔
//        Integer number = Collections.min(list);
//        bdto.setLineProjectGroup(bearingConstructionMapper.getLineProjectGroupTower(unitId) + number);
//        return bdto;
//
//
//    }
//
//    @Override
//    public WrappedResult<List<BearerConsUnitNameDTO>> getUnitNameList() {
//        List<BearerConsUnitNameDTO> bearerConsUnitNameDTOS = bearingConstructionMapper.getUnitNameListByLike();
//        return new WrappedResult<>(bearerConsUnitNameDTOS);
//    }
//
//    @Override
//    public NcPageInfo<BearerConstructionDTO> bearingList(PageQuery<BearingConstructionQueryVO> query) {
//        //查询需要分页的施工单位数
//        PageInfo<BearerConsUnitNameDTO> unitNameDTOPageInfo = bearingConstructionMapper.getUnitNameList(query).toPageInfo();
//        List<BearerConsUnitNameDTO> data = unitNameDTOPageInfo.getData();
//        //计算数据获取
//        List<BearingCalculationBO> bearingCalculationBOList = this.getBearingCalculationBOList(data);
//        //计算数据接口
//        List<BearerConstructionDTO> calculationData = this.getCalculationData(bearingCalculationBOList);
//        NcPageInfo<BearerConstructionDTO> ncPageInfo = new NcPageInfo<>(calculationData);
//        ncPageInfo.setPageNum((int) query.getPageNum());
//        ncPageInfo.setPageSize((int) query.getPageSize());
//        ncPageInfo.setTotal(unitNameDTOPageInfo.getTotal());
//        return ncPageInfo;
//    }
//
//    @Override
//    public List<BearerConstructionTotalDTO> export(List<BearerConstructionDTO> bearerConstructionDTOList) {
//        BearerConstructionTotalDTO bctd = new BearerConstructionTotalDTO(bearerConstructionDTOList);
//        bctd.setUnitName("合计");
//        bctd.setNotes("注: (1)“+”表示承载力可调配，“-”表示承载力可补充（或以饱和）" + "\n " +
//                "(2）对于线路工程承载力，每个班组年组搭（架设）能力约12公里。当线路工程规模较小时，应按线路工程数量配置作业班组");
//        List<BearerConstructionTotalDTO> bearerConstructionTotalDTOS = new ArrayList<>();
//        bearerConstructionTotalDTOS.add(bctd);
//        return bearerConstructionTotalDTOS;
//    }
//
//    /***
//     * 承载力报告
//     * 承载力分析结论与建议
//     * @param bearerConstructionDTOList
//     * @return
//     */
//    public String getBearingConclusion(List<BearerConstructionDTO> bearerConstructionDTOList) {
//        bearerConstructionDTOList.stream().forEach(bearerConstructionDTO -> {
//            Long id = bearerConstructionDTO.getId();
//            List<Integer> unitProjVoltageByUnitId = bearingConstructionMapper.getUnitProjVoltageByUnitId(id);
//            bearerConstructionDTO.setVoltageList(unitProjVoltageByUnitId);
//            //现有项目管理关键人员
//            PersonnelBO personnelBO = this.getPersonnel(id);
//            if (ObjectUtils.isEmpty(personnelBO)) {
//                bearerConstructionDTO.setPersonnelBO(new PersonnelBO(0, 0, 0, 0, 0));
//            } else {
//                bearerConstructionDTO.setPersonnelBO(personnelBO);
//            }
//        });
//        StringBuilder sb = new StringBuilder();
//        for (int i = 0; i < bearerConstructionDTOList.size(); i++) {
//            BearerConstructionDTO bearerConstructionDTO = bearerConstructionDTOList.get(i);
//            log.info(bearerConstructionDTO.getId() + "");
//            log.info(bearerConstructionDTO.getId() + "-----" + bearerConstructionDTO.getPersonnelBO().toString());
//            List<Integer> voltageList = bearerConstructionDTO.getVoltageList();
//            log.info("" + voltageList.size());
//            PersonnelBO personnelBO = bearerConstructionDTO.getPersonnelBO();
//            //结论与建议,公司名称在word里面的排版
//            sb.append("    "+(i + 1) + "." + bearerConstructionDTO.getUnitName() + "\r\n");
//            if (voltageList.size() > 1) {
//                sb.append("    在建工程数量:" + voltageList.get(0) + "~" + voltageList.get(voltageList.size() - 1) + "千伏在建变电工程");
//            } else {
//                sb.append("    在建工程数量:" + voltageList.get(0) + "千伏在建变电工程");
//            }
//            sb.append(bearerConstructionDTO.getElectricProjectAmount() +
//                    "个、容量" + bearerConstructionDTO.getSubstationCapacity() +
//                    "万千伏安，线路工程" + bearerConstructionDTO.getLineProjectAmount() +
//                    "个、长度" + bearerConstructionDTO.getLineLonger() +
//                    "公里。共需组建变电工程施工项目部" + bearerConstructionDTO.getEltProjectUsed() +
//                    "个，线路工程施工项目部" + bearerConstructionDTO.getLineProjectUsed() +
//                    "个、线路作业层班组" + bearerConstructionDTO.getLineProjectGroupUsed() + "个。" + "\r\n");
//            sb.append("    现有项目管理关键人员：该公司现有项目管理关键人员" + personnelBO.getPersonnels() +
//                    "人，其中变电项目管理关键人员" + personnelBO.getSubstationPersonnels() +
//                    "人，线路项目管理关键人员" + personnelBO.getLinePersonnels() +
//                    "人，变电作业层班组关键人员" + personnelBO.getSubstationTeamPersonnels() +
//                    "人，线路作业层班组关键人员" + personnelBO.getLineTeamPersonnels() + "人。\r\n");
//            sb.append("    施工承载力：该公司可同时组建变电工程施工项目部" + bearerConstructionDTO.getEltProjectDep() +
//                    "个、作业层班组" + bearerConstructionDTO.getEltProjectGroup() + "个，即同时承接" + bearerConstructionDTO.getEltProjectDep() + "个");
//            if (voltageList.size() > 1) {
//                sb.append(voltageList.get(0) + "~" + voltageList.get(voltageList.size() - 1));
//            } else {
//                sb.append(voltageList.get(0));
//            }
//            sb.append("千伏变电工程。可同时组建线路工程施工项目部" + bearerConstructionDTO.getLineProjectDep() +
//                    "个、作业层班组" + bearerConstructionDTO.getLineProjectGroup() +
//                    "个，即同时承接" + bearerConstructionDTO.getLineProjectDep() + "个");
//            if (voltageList.size() > 1) {
//                sb.append(voltageList.get(0) + "~" + voltageList.get(voltageList.size() - 1));
//            } else {
//                sb.append(voltageList.get(0));
//            }
//            sb.append("千伏线路工程，班组架线能力为" + bearerConstructionDTO.getLineProjectGroup() * 12 + "公里。\r\n");
//        }
//        return new String(sb);
//    }
//
//    /**
//     * 获取word中需要的数据 map
//     *
//     * @param map
//     * @return
//     */
//    @Override
//    public Map<String, Object> getWordDataMap(Map<String, Object> map) {
//        Integer unitTotal = bearingConstructionMapper.getUnitTotal();
//        PageQuery<BearingConstructionQueryVO> query = new PageQuery<>();
//        query.setPageSize(unitTotal);
//        query.setPageNum(1);
//        BearingConstructionQueryVO bearingConstructionQueryVO = new BearingConstructionQueryVO();
//        query.setQueryData(bearingConstructionQueryVO);
//        NcPageInfo<BearerConstructionDTO> ncPageInfo = this.bearingList(query);
//        //列表数据
//        List<BearerConstructionDTO> bearerConstructionDTOList = ncPageInfo.getData();
//        map.put("entitylist", bearerConstructionDTOList);
//        //合计数量
//        List<BearerConstructionTotalDTO> totalExport = this.export(bearerConstructionDTOList);
//        map.put("total", totalExport.get(0));
//        map.put("totalList", totalExport);
//        //承载力分析结论与建议
//        String bearingConclusion = this.getBearingConclusion(bearerConstructionDTOList);
//        map.put("bearingConclusion", bearingConclusion);
//        //当前输变电工程建设情况
//        String bearingReportPrjDetailDTO = this.getBearingReportPrjDetailDTO();
//        map.put("bearingReportPrjDetailDTO", bearingReportPrjDetailDTO);
//        //项目管理关键人员情况
//        String projectManagPerson = this.getProjectManagPerson();
//        map.put("projectManagPerson", projectManagPerson);
//        return map;
//    }
//
//    /**
//     * 承载力报告,在建输变电工程详情
//     *
//     * @return String
//     */
//    public String getBearingReportPrjDetailDTO() {
//        BearingReportPrjDetailDTO brpdd = new BearingReportPrjDetailDTO();
//        List<Map<String, Object>> totalByProjectType = bearingConstructionMapper.getTotalByProjectType();
//        totalByProjectType.stream().forEach(map -> {
//            String projectType = (String) map.get("projectType");
//            Integer total = Integer.valueOf("" + map.get("total"));
//            switch (projectType) {
//                case BearingConstructionConstant.OUT_SUBSTATION_ENGINEERING_PROJECT:
//                    brpdd.setOutSubsEngTotal(total);
//                    break;
//                case BearingConstructionConstant.SUBSTATION_ENGINEERING_PROJECT:
//                    brpdd.setSubsEngTotal(total);
//                    break;
//                case BearingConstructionConstant.LINE_PROJECT:
//                    brpdd.setLineProjectTotal(total);
//                    break;
//                default:
//            }
//        });
//        List<Map<String, Object>> votageGradeTotal = bearingConstructionMapper.getVotageGradeTotal(BearingConstructionConstant.SUBSTATION_ENGINEERING_PROJECT);
//        votageGradeTotal.stream().forEach(map -> {
//            String voltageGrade = (String) map.get("voltageGrade");
//            Integer total = Integer.valueOf("" + map.get("total"));
//            switch (voltageGrade) {
//                case BearingConstructionConstant.VOLTAGE_35KV:
//                    brpdd.setOutSubsEngTotal35kv(total);
//                    break;
//                case BearingConstructionConstant.VOLTAGE_110KV:
//                    brpdd.setOutSubsEngTotal110kv(total);
//                    break;
//                case BearingConstructionConstant.VOLTAGE_220KV:
//                    brpdd.setOutSubsEngTotal220kv(total);
//                    break;
//                case BearingConstructionConstant.VOLTAGE_500KV:
//                    brpdd.setOutSubsEngTotal500kv(total);
//                    break;
//                default:
//            }
//        });
//        //单体工程熟数量
//        brpdd.setMonomerEngineering(brpdd.getLineProjectTotal() + brpdd.getSubsEngTotal());
//        //变电工程容量
//        Double substationCapacityTotal = bearingConstructionMapper.getSubstationCapacityTotal();
//        brpdd.setSubstationCapacityTotal(substationCapacityTotal);
//        //线路工程长度
//        Double lineLongerTotal = bearingConstructionMapper.getLineLongerTotal();
//        brpdd.setLineLongerTotal(lineLongerTotal);
//        StringBuilder sb = new StringBuilder();
//        sb.append(" 目前湖南省共计有在建35千伏及以上输变电工程" + ((ObjectUtils.isEmpty(brpdd.getOutSubsEngTotal()) ? 0 : brpdd.getOutSubsEngTotal())) +
//                "项，含500千伏" + ((ObjectUtils.isEmpty(brpdd.getOutSubsEngTotal500kv()) ? 0 : brpdd.getOutSubsEngTotal500kv())) +
//                "项、220千伏" + ((ObjectUtils.isEmpty(brpdd.getOutSubsEngTotal500kv()) ? 0 : brpdd.getOutSubsEngTotal220kv())) +
//                "项、110千伏" + ((ObjectUtils.isEmpty(brpdd.getOutSubsEngTotal500kv()) ? 0 : brpdd.getOutSubsEngTotal110kv())) +
//                "项、35千伏" + ((ObjectUtils.isEmpty(brpdd.getOutSubsEngTotal500kv()) ? 0 : brpdd.getOutSubsEngTotal35kv())) + "项，");
//        sb.append("其中共计单体工程" + brpdd.getMonomerEngineering() +
//                "项，含变电工程" + brpdd.getSubsEngTotal() +
//                "项、容量" + brpdd.getSubstationCapacityTotal() +
//                "万千伏安，线路工程" + brpdd.getLineProjectTotal() +
//                "项、长度" + brpdd.getLineLongerTotal() + "公里。\r\n");
//        return new String(sb);
//    }
//
//    /**
//     * 项目管理关键人员情况
//     */
//    public String getProjectManagPerson() {
//        ProjectManagementPersonnelDTO pmpd = new ProjectManagementPersonnelDTO();
//        Integer unitTotal = bearingConstructionMapper.getUnitTotal();
//        pmpd.setUnitTotal(unitTotal);
//        List<Map<String, Object>> unitLevelAmount = bearingConstructionMapper.getUnitLevelAmount();
//        unitLevelAmount.stream().forEach(map -> {
//            String unitLevel = (String) map.get("unitLevel");
//            Integer total = Integer.valueOf("" + map.get("total"));
//            switch (unitLevel) {
//                case "省公司层面":
//                    pmpd.setProvincesUnitTotal(total);
//                    break;
//                case "地（市）公司层面":
//                    pmpd.setCityUnitTotal(total);
//                    break;
//                case "县公司层面":
//                    pmpd.setCountiesUnitTotal(total);
//                    break;
//                default:
//            }
//        });
//        List<Map<String, Object>> peopleAmountByMajor = bearingConstructionMapper.getPeopleAmountByMajor();
//        peopleAmountByMajor.stream().forEach(map -> {
//            String major = (String) map.get("major");
//            Integer total = Integer.valueOf("" + map.get("total"));
//            switch (major) {
//                case "变电":
//                    pmpd.setElePeopleAmount(total);
//                    break;
//                case "线路":
//                    pmpd.setLinePeopleAmount(total);
//                    break;
//                default:
//            }
//
//        });
//        StringBuilder sb = new StringBuilder();
//        sb.append(" 本报告共对" + pmpd.getUnitTotal() + "家施工企业承接35千伏及以上输变电工程的关键人员状况进行分析并形成其施工承载力结论，" +
//                "含" + pmpd.getProvincesUnitTotal() + "家省公司级施工企业、" + pmpd.getCityUnitTotal() + "家地市公司级（含超高压）施工企业。" +
//                pmpd.getUnitTotal() + "家施工企业共计有项目管理关键人员" + (pmpd.getElePeopleAmount() + pmpd.getLinePeopleAmount()) +
//                "名，其中变电专业" + pmpd.getElePeopleAmount() + "名、线路专业" + pmpd.getLinePeopleAmount() + "名。\r\n");
//        return new String(sb);
//    }
//
//    /**
//     * 数据获取
//     *
//     * @param data
//     * @return
//     */
//    private List<BearingCalculationBO> getBearingCalculationBOList(List<BearerConsUnitNameDTO> data) {
//        List<BearingCalculationBO> bearingCalculationBOList = new ArrayList<>();
//        for (int i = 0; i < data.size(); i++) {
//            BearerConsUnitNameDTO bearerConsUnitNameDTO = data.get(i);
//            Long unitId = bearerConsUnitNameDTO.getUnitId();
//            //这里不进行非空判断放在获取数据的时候进行非空判断
//            List<ElectricAmountLineLongerBO> longerBOList35Kv = bearingConstructionMapper.getUnitList(BearingConstructionConstant.VOLTAGE_35KV, unitId);
//            List<ElectricAmountLineLongerBO> longerBOList110kv = bearingConstructionMapper.getUnitList(BearingConstructionConstant.VOLTAGE_110KV, unitId);
//            List<ElectricAmountLineLongerBO> longerBOList220kv = bearingConstructionMapper.getUnitList(BearingConstructionConstant.VOLTAGE_220KV, unitId);
//            List<ElectricAmountLineLongerBO> longerBOList500kv = bearingConstructionMapper.getUnitList(BearingConstructionConstant.VOLTAGE_500KV, unitId);
//            List<ElectricAmountLineLongerBO> longerBOList750kv = bearingConstructionMapper.getUnitList(BearingConstructionConstant.VOLTAGE_750KV, unitId);
//            List<ElectricAmountLineLongerBO> longerBOListSuperkv = bearingConstructionMapper.getUnitList(BearingConstructionConstant.VOLTAGE_SUPER_KV, unitId);
//            //根据电压等级计算(可调配/以饱和)数据
//            Map<String, List<ElectricAmountLineLongerBO>> stringListMap = new HashMap<>();
//            stringListMap.put(BearingConstructionConstant.VOLTAGE_35KV, longerBOList35Kv);
//            stringListMap.put(BearingConstructionConstant.VOLTAGE_110KV, longerBOList110kv);
//            stringListMap.put(BearingConstructionConstant.VOLTAGE_220KV, longerBOList220kv);
//            stringListMap.put(BearingConstructionConstant.VOLTAGE_500KV, longerBOList500kv);
//            stringListMap.put(BearingConstructionConstant.VOLTAGE_750KV, longerBOList750kv);
//            stringListMap.put(BearingConstructionConstant.VOLTAGE_SUPER_KV, longerBOListSuperkv);
//
//            BearingCalculationBO bearingCalculationBO = new BearingCalculationBO();
//            bearingCalculationBO.setUnitId(unitId);
//            bearingCalculationBO.setUnitName(bearerConsUnitNameDTO.getUnitName());
//            bearingCalculationBO.setListMap(stringListMap);
//            bearingCalculationBOList.add(bearingCalculationBO);
//        }
//        return bearingCalculationBOList;
//    }
//
//    /**
//     * 返回的数据的计算
//     *
//     * @param bearingCalculationBOList
//     * @return
//     */
//    private List<BearerConstructionDTO> getCalculationData(List<BearingCalculationBO> bearingCalculationBOList) {
//        List<BearerConstructionDTO> bearerConstructionDTOList = new ArrayList<>();
//        bearingCalculationBOList.stream().forEach(bearingCalculationBO -> {
//            Long unitId = bearingCalculationBO.getUnitId();
//            String unitName = bearingCalculationBO.getUnitName();
//            BearerConstructionDTO bearerConstructionDTO = new BearerConstructionDTO();
//            bearerConstructionDTO.setId(unitId);
//            bearerConstructionDTO.setUnitName(unitName);
//            //变电工程总数量
//            int electricProjectAmount = 0;
//            //线路工程总数量
//            int lineProjectAmount = 0;
//            //所有工程总容量
//            double substationCapacity = 0;
//            //所有工程的线路长度
//            double lineLonger = 0;
//
//            //变电工程可组建项目部可调配数量 需计算
//            int eltProjectUsed = 0;
//            //变电工程建班组使用数量 现在没有算法
//            int eltProjectGroupUsed = 0;
//            //线路工程可组建项目部使用数量
//            int lineProjectUsed = 0;
//            //线路工程可组建班组使用数量
//            int lineProjectGroupUsed = 0;
//            Map<String, List<ElectricAmountLineLongerBO>> maplist = bearingCalculationBO.getListMap();
//            List<String> voltageList = BearingConstructionConstant.getVoltageList();
//            for (int a = 0; a < voltageList.size(); a++) {
//                String voltageRank = voltageList.get(a);
//                List<ElectricAmountLineLongerBO> electricAmountLineLongerBOList = maplist.get(voltageRank);
//                //如果map里面存的数据为空判断
//                if (CollectionUtils.isEmpty(electricAmountLineLongerBOList)) {
//                    continue;
//                }
//                for (int i = 0; i < electricAmountLineLongerBOList.size(); i++) {
//                    ElectricAmountLineLongerBO electricAmountLineLongerBO = electricAmountLineLongerBOList.get(i);
//                    //当前单位项目总容量
//                    substationCapacity += electricAmountLineLongerBO.getSubstationCapacity();
//                    //当前单位项目总长度
//                    lineLonger += electricAmountLineLongerBO.getLineLonger();
//
//                    String projectType = electricAmountLineLongerBO.getProjectType();
//                    switch (projectType) {
//                        //变电工程
//                        case BearingConstructionConstant.SUBSTATION_ENGINEERING_PROJECT:
//                            electricProjectAmount += electricAmountLineLongerBO.getProjectAmount();
//                            //变电项目部计算,施工班组计算
//                            Map<String, Integer> map = BearinCalculationUtils.elcSubstationDeptCalCalculation(electricAmountLineLongerBO, voltageRank, eltProjectUsed, eltProjectGroupUsed);
//                            eltProjectUsed += map.get(ELTPROJECTUSED);
//                            eltProjectGroupUsed += map.get(ELTPROJECTGROUPUSED);
//                            break;
//                        //输变电
//                        case OUT_SUBSTATION_ENGINEERING_PROJECT:
//                            electricProjectAmount += electricAmountLineLongerBO.getProjectAmount();
//                            lineProjectAmount += electricAmountLineLongerBO.getProjectAmount();
//                            Map<String, Integer> mapOne = BearinCalculationUtils.elcOutSubstationDeptCalCalculation(electricAmountLineLongerBO, voltageRank, eltProjectUsed, eltProjectGroupUsed);
//                            eltProjectUsed += mapOne.get(ELTPROJECTUSED);
//                            eltProjectGroupUsed += mapOne.get(ELTPROJECTGROUPUSED);
//                            Map<String, Integer> mapTwo = BearinCalculationUtils.lineOutDeptCalCalculation(electricAmountLineLongerBO, voltageRank, lineProjectUsed, lineProjectGroupUsed);
//                            lineProjectUsed += mapTwo.get(LINEPROJECTUSED);
//                            lineProjectGroupUsed += mapTwo.get(LINEPROJECTGROUPUSED);
//                            break;
//                        //扩建工程
//                        case BearingConstructionConstant.EXTENSION_PROJECT:
//                            electricProjectAmount += electricAmountLineLongerBO.getProjectAmount();
//                            Map<String, Integer> mapThree = BearinCalculationUtils.elcExtensionSubstationDeptCalCalculation(electricAmountLineLongerBO, voltageRank, eltProjectUsed, eltProjectGroupUsed);
//                            eltProjectUsed += mapThree.get(ELTPROJECTUSED);
//                            eltProjectGroupUsed += mapThree.get(ELTPROJECTGROUPUSED);
//                            break;
//                        //线路工程
//                        case BearingConstructionConstant.LINE_PROJECT:
//                            lineProjectAmount += electricAmountLineLongerBO.getProjectAmount();
//                            Map<String, Integer> mapLine = BearinCalculationUtils.lineDeptCalCalculation(electricAmountLineLongerBO, voltageRank, lineProjectUsed, lineProjectGroupUsed);
//                            lineProjectUsed += mapLine.get(LINEPROJECTUSED);
//                            lineProjectGroupUsed += mapLine.get(LINEPROJECTGROUPUSED);
//                            break;
//                        default:
//                    }
//                }
//
//            }
//
//            //变电工程数量
//            bearerConstructionDTO.setElectricProjectAmount(electricProjectAmount);
//            //当前单位项目总容量
//            bearerConstructionDTO.setSubstationCapacity(substationCapacity);
//            // 线路工程数量
//            bearerConstructionDTO.setLineProjectAmount(lineProjectAmount);
//            //当前单位项目总长度
//
//            bearerConstructionDTO.setLineLonger((double) Math.round(lineLonger * 1000) / 1000);
//            //获取施工单位人员可组建的项目部和班组数
//            BearerConstructionDTO powerProjects = this.getPowerProjects(unitId);
//            //变电工程可组建项目部数量  ;
//            bearerConstructionDTO.setEltProjectDep(powerProjects.getEltProjectDep());
//            //变电工程项目部可调节数
//            bearerConstructionDTO.setEltProjectDepResidue(powerProjects.getEltProjectDep() - eltProjectUsed);
//            //变电工程可组建班组数量
//            bearerConstructionDTO.setEltProjectGroup(powerProjects.getEltProjectGroup());
//            //变电工程可组建班组可调节数
//            bearerConstructionDTO.setEltProjectGroupResidue(powerProjects.getEltProjectGroup() - eltProjectGroupUsed);
//            //线路工程可组建项目部数量
//            bearerConstructionDTO.setLineProjectDep(powerProjects.getLineProjectDep());
////            log.info(bearingCalculationBO.getUnitName()+bearingCalculationBO.getUnitId()+powerProjects.toString());
//            bearerConstructionDTO.setLineProjectDepResidue(powerProjects.getLineProjectDep() - lineProjectUsed);
//            //线路工程可组建班组数量
//            bearerConstructionDTO.setLineProjectGroup(powerProjects.getLineProjectGroup());
//            bearerConstructionDTO.setLineProjectGroupResidue(powerProjects.getLineProjectGroup() - lineProjectGroupUsed);
//            //一下为承载力报告需要的字段
//            bearerConstructionDTO.setLineProjectUsed(lineProjectUsed);
//            bearerConstructionDTO.setLineProjectGroupUsed(lineProjectGroupUsed);
//            bearerConstructionDTO.setEltProjectUsed(eltProjectUsed);
//            bearerConstructionDTO.setEltProjectGroupUsed(eltProjectGroupUsed);
//            bearerConstructionDTOList.add(bearerConstructionDTO);
//        });
//        return bearerConstructionDTOList;
//    }
//}
